import ajax from '@/interfaces/ajax'

let Get = ajax.Get
const Home = {
    namespaced: true,
    state() {
        return {
            hotWord: '',
            sw: true
        }
    },
    actions: {
        async getHotword({ commit }) {
            let res = await Get(config.interface.getAdSwiper + '?siteMark=wap_index&ts')
            res = JSON.parse(res.replace(/^var\s+adList(?:\s+)?=(?:\s+)?/, ''))
            let word = res.WAP_search.data.content['0'].ad_content_title
            commit('wordMeths', word)
        }
    },
    getters: {

    },
    mutations: {
        wordMeths(state, word) {
            state.hotWord = word
        }
    },
    modules: {
        
    }
}

export default Home